home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / DIZZY / SRC / ELEMENTD.H < prev    next >
Text File  |  1990-12-29  |  2KB  |  49 lines

  1. /*
  2. >>    Dizzy 0.0    elementdefs.h
  3. >>
  4. >>    A digital circuit simulator & design program for the X Window System
  5. >>
  6. >>    Copyright 1990 Juri Munkki, all rights reserved
  7. >>
  8. >>    Please read the included file called "DizzyDoc" for information on
  9. >>    what your rights are concerning this product.
  10. */
  11.  
  12. #ifdef BIGENDIAN        /*    You need to define this when necessary!     */
  13. #define C4(a,b,c,d)     ((((long)d)<<24L)+(((long)c)<<16L)+(((long)b)<<8L)+a)
  14. #else
  15. #define C4(a,b,c,d)     ((((long)a)<<24L)+(((long)b)<<16L)+(((long)c)<<8L)+d)
  16. #endif
  17.  
  18. /*
  19. >>    Chip names are 32 bit constants. The interesting thing about them is
  20. >>    that if you look at them as character constants, they spell out element
  21. >>    names. A friend of mine claimed that this was a horrible cludge,
  22. >>    but IMHO, as long as it works, it's ok. It's not all that hard to
  23. >>    rewrite the program to use other constants. Just change the file
  24. >>    reading and writing operations to do conversions.
  25. >>
  26. >>    I'm already over my source code size limit by a factor of 3, so I won't do it.
  27. */
  28. #define NOT_    C4('N','O','T','_')     /*    Inverter.                    */
  29. #define AND_    C4('A','N','D','_')     /*    AND gate.                    */
  30. #define NAND    C4('N','A','N','D')     /*    NAND gate.                    */
  31. #define OR__    C4('O','R','_','_')     /*    OR gate.                    */
  32. #define NOR_    C4('N','O','R','_')     /*    NOR gate.                    */
  33. #define XOR_    C4('X','O','R','_')     /*    XOR gate.                    */
  34. #define NXOR    C4('N','X','O','R')     /*    NXOR OR gate. Obscure.        */
  35. #define INPT    C4('I','N','P','T')     /*    Input pin or element.        */
  36. #define OUTP    C4('O','U','T','P')     /*    Output pin or bit display.    */
  37. #define HEXD    C4('H','E','X','D')     /*    Hexadecimal display.        */
  38. #define D___    C4('D','_','_','_')     /*    Rising edge D flip flop.    */
  39. #define JK__    C4('J','K','_','_')     /*    Rising edge JK flip flop    */
  40. #define RS__    C4('R','S','_','_')     /*    Reset/Set flip flop memory. */
  41. #define CUST    C4('C','U','S','T')     /*    Any file included as custom.*/
  42. #define ONE_    C4('O','N','E','_')     /*    Constant 1 signal level.    */
  43. #define ZERO    C4('Z','E','R','O')     /*    Constant 0 signal level.    */
  44. #define CONN    C4('C','O','N','N')     /*    Signal passing joint.        */
  45. #define ZAPP    C4('Z','A','P','P')     /*    Food for garbage collector. */
  46. #define CLOK    C4('C','L','O','K')     /*    Clock chip.                 */
  47. #define ORIG    C4('O','R','I','G')     /*    Token for graphics origin.    */
  48. #define ENDF    C4('E','N','D','.')     /*    End of file token.            */
  49.